Fix Incoming Documents default processed filter - #9401
Fix Incoming Documents default processed filter#9401Jesper Schulz-Wedde (JesperSchulz) wants to merge 4 commits into
Conversation
Restore the default unprocessed view while preserving explicit processed filters and add regression coverage for each filter scenario. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a22e32be-3141-40ed-9a78-2302b3ba294f
Copilot PR ReviewIteration 4 · Outcome: completed
Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf Orchestrator pre-filter (2 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
Address review feedback by using the existing helper for the default unprocessed view. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a22e32be-3141-40ed-9a78-2302b3ba294f
Only apply the default unprocessed filter when no Processed filter is supplied, preserving the intent of bug 609129. Cover the action state for filtered entry points. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a22e32be-3141-40ed-9a78-2302b3ba294f
Clear and verify variable storage around the modal page handler so each filter scenario proves the expected interaction. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a22e32be-3141-40ed-9a78-2302b3ba294f
|
Re-running CI. Something is off with the one last task which keeps failing. |
| Rec.FilterGroup(0); | ||
| if Rec.GetFilter(Processed) <> '' then | ||
| SetProcessedDocumentsVisibility(Rec.GetFilter(Processed) = Format(true)); | ||
| if Rec.GetFilter(Processed) = '' then |
There was a problem hiding this comment.
This changes the externally observable OnOpenPage behavior of shipped page 190 "Incoming Documents" for callers that pass an Incoming Document record with a non-empty Processed filter into Page.Run/Page.RunModal: SetProcessedDocumentsVisibility is now never invoked for that case, so the caller's data filter is preserved, but the ShowAll/ShowUnprocessed action Enabled state (driven by ShowAllDocsIsEnable) no longer reflects the actual applied filter — it stays at its unprocessed default (ShowAll enabled, ShowUnprocessed disabled) regardless of whether the incoming filter was Processed=true or Processed=false. External extensions that open this page with a custom filter and rely on the previous enabled-state derivation will see inconsistent action availability relative to the data actually shown. Note the new tests (TestIncomingDocsPreserveProcessedFilter/TestIncomingDocsPreserveUnprocessedFilter) explicitly assert this new fixed enabled-state, indicating it may be an accepted trade-off rather than an oversight, but it should be called out explicitly since it is a change in externally visible UI state contract, not just an internal filter fix.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4
| [Test] | ||
| [HandlerFunctions('IncomingDocumentsProcessedFilterHandler')] | ||
| [Scope('OnPrem')] | ||
| procedure TestIncomingDocsPreserveUnprocessedFilter() |
There was a problem hiding this comment.
TestIncomingDocsPreserveUnprocessedFilter does not actually prove that an explicit Processed=false filter is preserved rather than dropped: with the current implementation, both an explicit Processed=false external filter and no filter at all (the default-to-unprocessed path) produce an identical observable result in the handler (Processed=false, one row, ShowAll enabled, ShowUnprocessed disabled). The test therefore cannot distinguish 'filter preserved' from 'filter ignored and default applied,' so it does not add coverage beyond TestIncomingDocsDefaultToUnprocessed for that specific claim. Consider asserting something that only holds if the original filter object survived (for example, verifying no additional filter-group manipulation occurred, or restructuring so the preserved-filter case uses a value that would differ from the default outcome if broken).
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4
|
|
||
| [ModalPageHandler] | ||
| [Scope('OnPrem')] | ||
| procedure IncomingDocumentsProcessedFilterHandler(var IncomingDocuments: TestPage "Incoming Documents") |
There was a problem hiding this comment.
IncomingDocumentsProcessedFilterHandler hardcodes its expectations (row count, ShowAll.Enabled(), ShowUnprocessed.Enabled()) instead of having the calling test enqueue those expected values for the handler to dequeue and verify. Per BCQuality testing guidance, the test should own and enqueue the expected interaction state (including the enabled/disabled action states and expected row count) in call order, and the handler should only Dequeue and assert against that queued value — this makes handler/test mismatches explicit rather than baked into the handler, and keeps the three call sites (TestIncomingDocsDefaultToUnprocessed, TestIncomingDocsPreserveProcessedFilter, TestIncomingDocsPreserveUnprocessedFilter) from silently sharing hardcoded assumptions that don't vary per scenario.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4
What & why
Incoming Documents no longer defaulted to unprocessed records when opened without a filter, and an explicit
Processed = truefilter could be cleared. Restore the defaultProcessed = falseview while preserving explicitly suppliedtrueandfalsefilters.Regression tests cover all three filter scenarios.
Linked work
Fixes AB#637747
How I validated this
What I tested and the outcome (required - be specific: scenarios, commands, screenshots for UI changes)
Processed = trueandProcessed = falsefilters are preserved.Risk & compatibility
Low risk. The change only affects initial page filter handling and retains existing Show All/Show Unprocessed action behavior. No data, permissions, or upgrade impact.